<template>
	<view class="bill-page">
		<mescroll-uni @init="mescrollInit" @down="downCallback" @up="upCallback" height="100%">
			<u-cell-group :border="false">
				<u-cell-item :title="item.mark" :label="item.add_time" :arrow="false" :title-style="{fontSize:'32rpx'}"
					:label-style="{fontSize:'28rpx',color:'#999999'}" hover-class="none" v-for="(item,index) in list"
					:key="index">
					<text slot="right-icon" class="black u-font-32">{{item.pm?'+':'-'}}{{item.number}}</text>
				</u-cell-item>
			</u-cell-group>
		</mescroll-uni>
	</view>
</template>

<script>
	import MescrollMixin from "@/uni_modules/mescroll-uni/components/mescroll-uni/mescroll-mixins.js";
	export default {
		mixins: [MescrollMixin],
		data() {
			return {
				list: []
			}
		},
		onLoad() {

		},
		methods: {
			upCallback(page) {
				this.getListData(page)
			},
			getListData(page) {
				this.$u.api.billList({
					page: page.num,
					limit: page.size
				}).then(res => {
					this.mescroll.endSuccess(res.length);
					if (page.num == 1) this.list = []
					this.list = this.list.concat(res);
				})
			}
		}
	}
</script>

<style scoped lang="scss">
	.bill-page {
		background-color: #fff;
		height: 100vh;
	}
</style>